package jp.joogoo.web.controller;

import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;

import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;

public class AddserviceController extends Controller {

    @Override
    protected Navigation run() throws Exception {
        UserService userService = UserServiceFactory.getUserService();
        User user = userService.getCurrentUser();
        
        if ( user != null ) {
            requestScope("logoutUrl", userService.createLogoutURL("/"));
            return forward("addservice.jsp");
        } else {
            return redirect("/");
        }
    }
}
